package com.ruoyi.web.controller.api.config;


import com.ruoyi.web.controller.api.dto.RequestPayload;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;

@Configuration
public class AppConfig {
    @Bean
    public RestTemplate restTemplate() {
        SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
        requestFactory.setReadTimeout(100000);
        requestFactory.setConnectTimeout(100000);
        return new RestTemplate(requestFactory);
    }

    @Bean
    public RequestPayload requestPayload() {
        return new RequestPayload(
                "example query", // query
                "thesis", // knowledgeBaseName
                5, // topK
                1, // scoreThreshold
                null, // history (you can provide a real list here)
                false, // stream
                "chatglm3-6b", // modelName
                0.7, // temperature
                0, // maxTokens
                "topic" // promptName
        );
    }
}
